package com.qq5194102.simpleskills.util;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

/**
 * @Author caiyh
 * @Date 2025/7/22 20:11
 * @Description
 */
public class SwordUtil {
    /**
     * 判断是否是主手持剑
     */
    public static boolean playerMainHandIsSword(Player player) {
        ItemStack mainHand = player.getInventory().getItemInMainHand();
        Material type = mainHand.getType();
        String materialName = type.name().toUpperCase();
        return materialName.endsWith("_SWORD");
    }
}
